package com.caimiao.miao.library.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MatchUtil {

    public static boolean isCompleteUrl(String text) {
        Pattern p = Pattern.compile("^((http|ftp|https)://)(([a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9\\&%_\\./-~-]*)?$", Pattern.CASE_INSENSITIVE);
        Matcher matcher = p.matcher(text);
        return matcher.matches();
    }

}
